<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/dist/plugins/vue/vue.js"></script>
</head>
<body>
<div id="app">
<textarea style="height:200px;width:200px;border:1px solid black;" v-model="user.desc"></textarea>
<br/>
<input value="转换为json对象" type="button" @click="convertObj">
    2
    2
</div>
<script type="text/javascript">
    var app = new Vue({
        el:'#app',
        data:{
            user:{
                desc:''
            }
        },
        methods:{
            convertObj:function () {
                console.log(this.user);
                console.log(this.user.desc);
                console.log(this.user.desc.replace("\t"," "));
                var str = JSON.stringify(this.user)
                console.log(str);
                console.log(JSON.parse(str));
            }
        }
    });
</script>
</body>
</html>